HAL UART state and error functions migration ¶
This section provides information about the HAL UART state and error functions migration.
HAL UART get state ¶
- In HAL2, Separate functions are added for specific state machines:
-
HAL_UART_GetTxState()to check the transmission state.HAL_UART_GetRxState()to check the reception state.
|
HAL1 |
HAL2 |
|---|---|
HAL_UART_GetState(UART_HandleTypeDef *huart)
|
HAL_UART_GetState (const hal_uart_handle_t *huart)
HAL_UART_GetTxState(const hal_uart_handle_t *huart)
HAL_UART_GetRxState(const hal_uart_handle_t *huart)
|
Related concepts: Revised and optimized HAL state machine
HAL UART get error ¶
|
HAL1 |
HAL2 |
|
|---|---|---|
|
Description |
In HAL1, the function
|
In HAL2, the function
|
|
Function name |
HAL_UART_GetError(UART_HandleTypeDef *huart);
|
HAL_UART_GetLastErrorCodes(const hal_uart_handle_t *huart);
|
Note
In HAL2, the constant
HAL_UART_ERROR_INVALID_CALLBACK
has been removed. Instead, functions
HAL_UART_RegisterXXXCallback()
return
HAL_INVALID_PARAM
in case of an invalid callback pointer.
Related concepts: Revised and optimized HAL error management